package com.ys.erp.entity.data.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lwj
 * @date 2025/5/22
 */
    
@Data
@TableName(value = "t_user_pulse_record")
public class UserPulseRecord {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户id
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 幺豆编号
     */
    @TableField(value = "pulse_no")
    private String pulseNo;

    /**
     * IN:收入，OUT:支出
     */
    @TableField(value = "record_type")
    private String recordType;

    /**
     * EMP_ADD:平台补偿赠送
IN_MONEY_GIFT:幺币充值赠送
ACTIVE_REWARD:活动奖励
SIGN_ADD:日常签到
ORDER_REFUND:商品退款退回
     */
    /**
     * EMP_REDUCE:平台手动扣除
     ORDER_USE:购买商品消耗
     JOIN_ACTIVE:参与活动消耗
     */
    @TableField(value = "in_out_type")
    private String inOutType;

    /**
     * 记录金额
     */
    @TableField(value = "record_num")
    private Long recordNum;

    /**
     * 记录时间
     */
    @TableField(value = "record_time")
    private LocalDateTime recordTime;

    /**
     * 管理信息
     */
    @TableField(value = "rela_no")
    private String relaNo;

    /**
     * 操作人id
     */
    @TableField(value = "emp_id")
    private Long empId;

    /**
     * 操作人名字
     */
    @TableField(value = "emp_name")
    private String empName;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    @TableField(value = "version")
    @Version
    private Integer version;

    @TableField(value = "create_time")
    private LocalDateTime createTime;

    @TableField(value = "update_time", update = "now()")
    private LocalDateTime updateTime;

    @AllArgsConstructor
    @Getter
    public enum Enums {
        IN,
        OUT,

        EMP_ADD,
        IN_MONEY_GIFT,
        ACTIVE_REWARD,
        SIGN_ADD,
        ORDER_REFUND,

        EMP_REDUCE,
        ORDER_USE,
        JOIN_ACTIVE
        ;

    }

    public static final Map<String, String> ENUM_MAP = new HashMap<>();

    static {
        ENUM_MAP.put(UserPulseRecord.Enums.IN.toString(), "收入");
        ENUM_MAP.put(UserPulseRecord.Enums.OUT.toString(), "支出");

        ENUM_MAP.put(UserPulseRecord.Enums.EMP_ADD.toString(), "平台补偿赠送");
        ENUM_MAP.put(UserPulseRecord.Enums.IN_MONEY_GIFT.toString(), "幺币充值赠送");
        ENUM_MAP.put(UserPulseRecord.Enums.ACTIVE_REWARD.toString(), "活动奖励");
        ENUM_MAP.put(UserPulseRecord.Enums.SIGN_ADD.toString(), "日常签到");
        ENUM_MAP.put(UserPulseRecord.Enums.ORDER_REFUND.toString(), "商品退款退回");

        ENUM_MAP.put(UserPulseRecord.Enums.EMP_REDUCE.toString(), "平台手动扣除");
        ENUM_MAP.put(UserPulseRecord.Enums.ORDER_USE.toString(), "购买商品消耗");
        ENUM_MAP.put(UserPulseRecord.Enums.JOIN_ACTIVE.toString(), "参与活动消耗");

    }

}